package cn.gson.crm.model.entity;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;

/**
 * 报价实体类
 * 
 * @author hzl
 * @date 2018年4月8日
 * @time 下午8:44:45
 */
@Entity
@Table(name = "crm_quotation")
public class Quotation {
	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	private Long id;
	/**
	 * 时间
	 */
	private Date time;
	/**
	 * 总报价
	 */
	private double money;
	/**
	 * 审批状态
	 */
	@Column(name="approval_status")
	private boolean approvalStatus;
	/**
	 * 审批结果
	 */
	@Column(name="approval_result")
	private boolean approvalResult;
	
	/**
	 * 对应销售机会
	 */
	@ManyToOne
	private SalesOpportunity salesOpp;
	/**
	 * 报价员
	 */
	@ManyToOne
	private Employee employee;
	/**
	 * 审批员
	 */
	@ManyToOne
	private Employee approvalEmployee;
	public Long getId() {
		return id;
	}
	public void setId(Long id) {
		this.id = id;
	}
	public Date getTime() {
		return time;
	}
	public void setTime(Date time) {
		this.time = time;
	}
	public double getMoney() {
		return money;
	}
	public void setMoney(double money) {
		this.money = money;
	}
	public boolean isApprovalStatus() {
		return approvalStatus;
	}
	public void setApprovalStatus(boolean approvalStatus) {
		this.approvalStatus = approvalStatus;
	}
	public boolean isApprovalResult() {
		return approvalResult;
	}
	public void setApprovalResult(boolean approvalResult) {
		this.approvalResult = approvalResult;
	}
	public SalesOpportunity getSalesOpp() {
		return salesOpp;
	}
	public void setSalesOpp(SalesOpportunity salesOpp) {
		this.salesOpp = salesOpp;
	}
	public Employee getEmployee() {
		return employee;
	}
	public void setEmployee(Employee employee) {
		this.employee = employee;
	}
	public Employee getApprovalEmployee() {
		return approvalEmployee;
	}
	public void setApprovalEmployee(Employee approvalEmployee) {
		this.approvalEmployee = approvalEmployee;
	}
	public Quotation() {
		// TODO Auto-generated constructor stub
	}
	public Quotation(Long id, Date time, double money, boolean approvalStatus, boolean approvalResult,
			SalesOpportunity salesOpp, Employee employee, Employee approvalEmployee) {
		super();
		this.id = id;
		this.time = time;
		this.money = money;
		this.approvalStatus = approvalStatus;
		this.approvalResult = approvalResult;
		this.salesOpp = salesOpp;
		this.employee = employee;
		this.approvalEmployee = approvalEmployee;
	}
	@Override
	public String toString() {
		return "Quotation [id=" + id + ", time=" + time + ", money=" + money + ", approvalStatus=" + approvalStatus
				+ ", approvalResult=" + approvalResult + "]";
	}
	
	
}
